/*
 * @Author: kanglang
 * @Date: 2021-03-06 14:24:33
 * @LastEditors: kanglang
 * @LastEditTime: 2021-03-06 15:29:05
 * @Description: 重新定位item
 */
import React from 'react';
import { Image, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
import { px2dp, fontColorCoffee } from '@/styles';
import { position, iconPositioning } from '@/images';

const ResetPosition = ({ onPress, address }) => {
  const handle = () => {
    onPress && onPress();
  };

  return (
    <View style={styles.container}>
      <View style={styles.addressBox}>
        <Image
          style={styles.positionIcon}
          source={position}
        />
        <Text style={styles.address}>{address}</Text>
      </View>
      <View style={styles.rightBtnBox}>
        <TouchableOpacity
          style={styles.btnBox}
          onPress={handle}
        >
          <Image
            style={styles.rightResetPosition}
            source={iconPositioning}
          />
          <Text style={styles.positionTip}>重新定位</Text>
        </TouchableOpacity>
      </View>
    </View>
  );
};
export default ResetPosition;
const styles = StyleSheet.create({
  container: {
    height: px2dp(80),
    justifyContent: 'space-between',
    alignItems: 'center',
    flexDirection: 'row',
  },
  addressBox: {
    flexDirection: 'row',
    alignItems: 'center',
    flex: 1
  },
  positionIcon: {
    width: px2dp(26),
    height: px2dp(24),
    marginRight: px2dp(5)
  },
  address: {
    color: '#999796',
    fontSize: px2dp(28),
    flex: 1
  },
  rightBtnBox: {
    flexDirection: 'row',
    justifyContent: 'space-between',
  },
  btnBox: {
    flexDirection: 'row',
    alignItems: 'center',
  },
  rightResetPosition: {
    width: px2dp(24),
    height: px2dp(24),
    marginRight: px2dp(5)
  },
  positionTip: {
    color: fontColorCoffee,
    fontSize: px2dp(24)
  }

});
